#region Summary

// 
// Owner : JackieHan 
// 
// Solution : LearnSolution 
// 
// Project : JackieHan.NHiberante.SessionManage
// 
// File : Config.cs
// 
// CopyRight : Copyright © 2010-2011 Skomart Corporation, All Rights Reserved 
// 
// Summary : Session 管理配置
// 
// History : 
//			2010-09-28 13:31:00	    Create 
// 

#endregion

#region Using

using System;
using System.Collections.Generic;
using System.Configuration;

#endregion

namespace JackieHan.NHiberante.SessionManage
{
    /// <summary> 
    /// Session 管理配置
    /// </summary>
    public class Config
    {
        private static object lockObj = new object();
        private static string httpSessionStorageItemName;

        /// <summary>
        /// HttpSessionSource存放HttpContext.Current.Items的键值名
        /// </summary>
        public static string HttpSessionSourceItemName
        {
            get
            {
                lock (lockObj)
                {
                    if (httpSessionStorageItemName == String.Empty)
                    {
                        return ConfigurationManager.AppSettings["HttpSessionSourceItemName"];
                    }
                    else
                    {
                        return httpSessionStorageItemName;
                    }
                }
            }
        }

        /// <summary>
        /// 是否使用Session资源源
        /// </summary>
        public static bool UserSessionSource
        {
            get
            {
                lock (lockObj)
                {
                    return Convert.ToBoolean(ConfigurationManager.AppSettings["UserSessionSource"]);
                }
            }
        }
    }
}